package com.example.test.controller;

import com.example.test.service.IUserService;
import com.example.test.vo.ResponseVo;
import com.example.test.vo.UserVo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private IUserService userService;

    @GetMapping("/list")
    public ResponseVo<UserVo> getUserInfo(@RequestParam Integer userId) {
        UserVo userInfo = userService.getUserInfo(userId);

        return ResponseVo.success(userInfo);
    }
}
